package com.cpe.config;

import javax.annotation.Resource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

import com.cpe.env.LandingEnv;

@Configuration
@ComponentScan("com.cpe.transfer")
@PropertySource({ "classpath:landing.properties" })
public class TransferApplicationConfig {

	@Resource
	private Environment environment;

	@Bean
	public LandingEnv landingEnv() {
		LandingEnv landingEnv = new LandingEnv();
		String host = environment.getProperty("landing.host");
		String lessonDetail = environment.getProperty("landing.lesson.detail");
		landingEnv.setHost(host);
		landingEnv.setLessonDetail(lessonDetail);
		return landingEnv;
	}
}
